Skip to content

fix(mcp): add timeout and process kill to test tool#1595

Open
eliasreis54 wants to merge 4 commits into
VeryGoodOpenSource:mainfrom
eliasreis54:fix/mcp-test-timeout
Open

fix(mcp): add timeout and process kill to test tool#1595
eliasreis54 wants to merge 4 commits into
VeryGoodOpenSource:mainfrom
eliasreis54:fix/mcp-test-timeout

Conversation

@eliasreis54
Copy link
Copy Markdown
Contributor

@eliasreis54 eliasreis54 commented May 13, 2026

Status

READY

Description

Flutter tests can hang indefinitely when pumpAndSettle() is called without a timeout argument. The MCP server was waiting on the process forever with no way to recover.

Adds a timeout_seconds parameter (default 120) to the test tool. When the timeout fires, sends SIGKILL to flutter_tester via pkill — the only reliable mechanism to terminate a hung Flutter test process — then returns an actionable error to the caller.

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

Flutter tests can hang indefinitely when pumpAndSettle() is called
without a timeout argument. The MCP server was waiting on the process
forever with no way to recover.

Adds a timeout_seconds parameter (default 120) to the test tool. When
the timeout fires, sends SIGKILL to flutter_tester via pkill — the only
reliable mechanism to terminate a hung Flutter test process — then
returns an actionable error to the caller.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eliasreis54 eliasreis54 requested a review from a team as a code owner May 13, 2026 13:23
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@ryzizub ryzizub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @eliasreis54, this might fix the MCP issue where timeouts from flutter test aren't bubbled up. But since the same issue exists in the very_good test command itself, shouldn't the fix be applied there too?

There we might find better way to tackle this, because this might introduce many issues (120 seconds for large codebases is quite aggresive)

eliasreis54 and others added 2 commits May 18, 2026 08:28
Adds a --timeout <seconds> option to very_good test. When set, a Timer
fires pkill -KILL -f flutter_tester and completes the test run with a
non-zero exit code. No timeout is applied when the flag is omitted.

The MCP server's own .timeout() + pkill block is removed in favour of
passing --timeout directly to the CLI, keeping the kill logic in one place.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants